package com.powernode;

/**
 * @version 1.0
 * @Date 2024/8/14 11:28
 * @Author 付~~~
 */

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.Bean;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

/**
 * 系统管理模块启动类
 */
@SpringBootApplication
@EnableDiscoveryClient
@EnableCaching  // 开启注解式缓存(默认使用的缓存中间件时redis)
public class ManagerServiceApplication {
    public static void main(String[] args) {
        SpringApplication.run(ManagerServiceApplication.class,args);
    }

    /**
     * 添加一个加密器，给密码设置为铭文,spring Security框架中的密码加密器
     */
    @Bean
    public BCryptPasswordEncoder passwordEncoder(){
        return new BCryptPasswordEncoder();
    }

}